﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Auto.Data.Common;
using Auto.Web.Common;

namespace Auto.BusMan.UserControl
{
    public partial class ucPhraseLabel : System.Web.UI.UserControl
    {
        #region --Property--

        public string PhraseClass
        {
            get { return (ViewState["PhraseClass"] == null) ? "" : (string)ViewState["PhraseClass"]; }
            set { ViewState["PhraseClass"] = value; }
        }

        /// <summary>
        /// Label
        /// </summary>
        public Label Label
        {
            get { return lblPhrase; }
        }

        /// <summary>
        /// Width of Label
        /// </summary>
        public Unit Width
        {
            set { lblPhrase.Width = value; }
        }

        /// <summary>
        /// SelectedText
        /// </summary>
        public string Text
        {
            get { return lblPhrase.Text; }
            set
            {
                InitControl(value);
            }
        }
        #endregion --Property--

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// Fill the Data to the Control
        /// </summary>
        private void InitControl(string phraseValue)
        {
            SysPhrase.SysPhraseDetail detail = new SysPhrase.SysPhraseDetail(SessionBox.CurrentSystem, PhraseClass.ToString(), phraseValue);
           lblPhrase.Text = detail.PhraseText;
        }
    }
}